<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/25
 * Time: 17:54
 */

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\ActivityService;

class ActivityController extends BaseController
{

    /**
     *  按门店获取所有有效的活动列表
     *  hinq 2019 11 25
     *
     **/
    public function index(){
        $arr_list = ActivityService::get_list();
        return response_json( $arr_list );
    }

    /**
     *  获取指定门店的所有商品列表
     *  hinq 2019 11 25
     *
     **/
    public function shop_list( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = ActivityService::get_shop_list( (int) $nId );
        return response_json( $arr_list );
    }


    /**
     *  获取活动banner列表
     *  hinq 2019 12 09
     *
     **/
    public function activity_banner(){
        $arr_list = ActivityService::get_activity_banner();
        return response_json( $arr_list );
    }

    /**
     *  获取banner列表
     *  hinq 2019 12 09
     *
     **/
    public function banner( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = ActivityService::banner( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  获取指定商品是否绑定活动
     *  hinq 2020 5 29
     *
     **/
    public function goods_is_del( Request $request ){
        $nid = (int) $request->get('id');
        $arr_list = ActivityService::goods_is_del( (int) $nid );
        return response_json( $arr_list );
    }




}